home *** CD-ROM | disk | FTP | other *** search
- class classes.fx.RampageTrail
- {
- var x;
- var y;
- var id;
- var clip;
- var cMax;
- var trans;
- var colorTrans;
- var colorArray;
- var colorL;
- var colorC;
- var xMov = 0;
- var yMov = 0;
- var c = 0;
- var colorArray1 = [[255,0,0],[255,125,0],[255,255,0],[255,125,0],[255,255,255],[255,0,0],[255,255,0],[255,125,0],[255,0,0]];
- var colorArray2 = [[0,255,0],[0,255,125],[0,255,255],[0,125,255],[0,0,255],[255,255,255],[125,255,255],[0,125,255],[0,255,255]];
- var colorArray3 = [[0,125,255],[255,0,125],[255,0,255],[255,255,255],[255,0,125],[0,255,255],[125,255,255],[0,125,255],[0,255,0]];
- var Name = "rampageTrail";
- function RampageTrail(px, py, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("rampageTrail","rampageTrail" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.gotoAndStop("shape4");
- if(random(2) > 0)
- {
- this.xMov = _root.randRange(-3,3);
- }
- else
- {
- this.yMov = _root.randRange(-3,3);
- }
- this.cMax = _root.randRange(20,50);
- this.trans = new flash.geom.Transform(this.clip);
- this.colorTrans = new flash.geom.ColorTransform(0,0,0,1,0,0,0,1);
- this.colorArray = this["colorArray" + _root.randRange(1,3)].slice();
- delete this.colorArray1;
- delete this.colorArray2;
- delete this.colorArray3;
- this.colorL = this.colorArray.length;
- this.colorC = -1;
- }
- function main()
- {
- this.c = this.c + 1;
- if(this.c >= this.cMax)
- {
- _root.removeFX("rampageTrail" + this.id);
- }
- this.colorC = this.colorC + 1;
- if(this.colorC > this.colorL)
- {
- this.colorC = 0;
- }
- this.colorTrans.redOffset = this.colorArray[this.colorC][0];
- this.colorTrans.greenOffset = this.colorArray[this.colorC][1];
- this.colorTrans.blueOffset = this.colorArray[this.colorC][2];
- this.trans.colorTransform = this.colorTrans;
- this.clip._alpha = 100 - this.c * (100 / this.cMax);
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-